<template>
  <button @click="increment">
    Count值是: {{ state.count }}, double值是: {{ state.doubleCount }}
  </button>
</template>

<script>
  import { reactive, computed } from 'vue'

  export default {
    setup() {
      const state = reactive({
        count: 0,
        doubleCount: computed(() => state.count * 2)
      })

      const increment = () => state.count++

      return {
        state,
        increment
      }
    },
  }
</script>